package com.jt.mall.controller;

import com.github.pagehelper.PageInfo;
import com.jt.mall.common.entity.RspResult;
import com.jt.mall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangning
 * @create 2021-12-23 15:45
 */
@RestController
public class UserController {
	@Autowired
	private UserService userService;

	@GetMapping("/user/list")
	public RspResult findAll() {
//		return RspResult.ok(userService.findAll());
//		return RspResult.ok();
		System.out.println("测试devtools");
		System.out.println("测试devtools");
		return RspResult.ok("查询成功", userService.findAll());
//		return RspResult.ok("新增成功");
	}
	
	@GetMapping("/user/page")
	public RspResult page() {
		PageInfo list = userService.list(1, 10);
		return RspResult.ok(list);
	}
}
